//
//  FWIndicatorSegmentCotrol.h
//  iOSToolkit
//
//  Created by Evan Xie on 5/27/15.
//  Copyright (c) 2015 Family Wings. All rights reserved.
//

#import <UIKit/UIKit.h>


@class FWIndicatorSegmentCotrol;

@protocol FWIndicatorSegmentCotrolDataSource <NSObject>
@required
- (NSUInteger)numberOfSegments;
- (UIImage *)indicatorSegmentControl:(FWIndicatorSegmentCotrol *)segmentControl iconForSegmentAtIndex:(NSUInteger)index;
- (NSString *)indicatorSegmentControl:(FWIndicatorSegmentCotrol *)segmentControl textForSegmentAtIndex:(NSUInteger)index;
@end

@protocol FWIndicatorSegmentCotrolDelegate <NSObject>
- (void)indicatorSegmentControl:(FWIndicatorSegmentCotrol *)segmentControl didSelectIndex:(NSUInteger)selectedIndex;
@end


@interface FWIndicatorSegmentCotrol : UIView

@property (nonatomic, weak) id <FWIndicatorSegmentCotrolDataSource> dataSource;
@property (nonatomic, weak) id <FWIndicatorSegmentCotrolDelegate> delegate;

@property (nonatomic, assign) NSUInteger selectedIndex;

@property (nonatomic, strong) UIFont *textFont;

- (instancetype)initWithFrame:(CGRect)frame cornerRadius:(CGFloat)cornerRadius;

- (void)setIndicatorColor:(UIColor *)indicatorColor indicatorImage:(UIImage *)indicatorImage;
- (void)setNormalTextColor:(UIColor *)normalTextColor selectedTextColor:(UIColor *)selectedTextColor;

@end
